package com.nit.vehicle.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import javax.naming.NamingException;

import com.nit.vehicle.dto.LoginFormDTO;
import com.nit.vehicle.utils.DBUtils;

public class LoginFormDAO {
	boolean flag = false;
	Connection con = null;
	public boolean authenticate(LoginFormDTO lfdto) throws NamingException, SQLException{
		try {
			con = DBUtils.getConnection();
      System.out.println("hiiiiii2");   
			PreparedStatement pstmt = con.prepareStatement("select * from userdet where uname is " + lfdto.getUserName() + " pwd is " + lfdto.getPwd());
			flag = pstmt.execute();
		} catch (NamingException e) {
			//logging
			throw e;
		} catch (SQLException e) {
			//logging
			throw e;
		}
		return flag;
    // i added something here in repository(google code)    
	}

}
